package com.hsy.linemoney.common;

import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;

import com.hsy.linemoney.R;
import com.hsy.linemoney.modules.common.CommonBaseActivityWithSimpleActionBar;
import com.hsy.linemoney.modules.main.MainActivity;

public class SuccessActivity extends CommonBaseActivityWithSimpleActionBar {
    private TextView continue_tender;

    @Override
    public boolean onActionBarLeftButtonClicked(ImageButton leftButton) {

        startActivityWithTaskCleared(MainActivity.class, Consts.Keys.TENDER);
        return super.onActionBarLeftButtonClicked(leftButton);
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {

        if (keyCode == KeyEvent.KEYCODE_BACK) {
            startActivityWithTaskCleared(MainActivity.class,Consts.Keys.TENDER);
            return false;
        }
        return super.onKeyDown(keyCode, event);

    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_success);
        setTitle(R.string.txt_tender_success);

        continue_tender = F(R.id.continue_tender);
        continue_tender.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivityWithTaskCleared(MainActivity.class,Consts.Keys.TENDER);
            }
        });
    }
}
